#ifndef __ADC_HAL_H__
#define __ADC_HAL_H__



#include <stdint.h>
#include "main.h"


typedef struct 
{
	GPIO_TypeDef *GPIOx;
	uint32_t	  Periph;	
	uint16_t	  PIN;
}ADC_GPIO_PARAM;

typedef struct 
{
	ADC_TypeDef   *ADCx;
	uint32_t	  Periph;
	uint8_t 	  num_;
}ADC_PARAM;

typedef struct
{
	uint8_t 	   CH;
	uint8_t 	   Rank;
	uint8_t		   Cycle;
}CH_PARAM;
	
typedef struct 
{
	DMA_Channel_TypeDef 		*CH;
	IRQn_Type 					irq;
	uint32_t	  				Periph;
	uint32_t 					*pbAddr;
	uint32_t 					*mbAddr;
	uint32_t					bufSize;	
}DMA_PARAM;

typedef struct 
{
	ADC_PARAM		ADC;
	DMA_PARAM		DMA;
	ADC_GPIO_PARAM 	GPIO[16];
	CH_PARAM		CH[16];
}ADC_INIT_PARAM;

typedef void (*dma_handle)(void);

void ADC_HAL_INIT(ADC_INIT_PARAM ADC_INIT);
void DMA_ir_register(dma_handle handle);
#endif





